# 生成文档

from mkdocs.commands.build import build
from mkdocs.config import load_config

def build_docs():
    try:
        # 加载默认配置文件（mkdocs.yml）
        config = load_config()
        # 构建文档
        build(config)
        print("文档构建成功！")
    except Exception as e:
        print(f"文档构建失败: {e}")

if __name__ == "__main__":
    build_docs()